package com.mediastory.spsserver.eventFile.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mediastory.spsserver.eventFile.dao.EventFileDao;
import com.mediastory.spsserver.eventFile.domain.EventFile;
import com.mediastory.spsserver.eventFile.service.EventFileSvc;

@Service
@Transactional
public class EventFileSvcImpl implements EventFileSvc {

	@Autowired
	EventFileDao eventFileDao;

	public EventFileSvcImpl() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public List<EventFile> findbyList(Map<String, Object> condition)
			throws Exception {
		// TODO Auto-generated method stub
		return (List<EventFile>) (eventFileDao.SelectList(condition));
	}

	public Map<String, Object> findbyListPaging(Map<String, Object> condition)
			throws Exception {
		// TODO Auto-generated method stub
		Map<String, Object> resultMap = new HashMap<String, Object>();
		resultMap.put("eventList", (List<EventFile>) (eventFileDao.SelectList(condition)));
		resultMap.put("eventListTotalCnt", (Integer) (eventFileDao.SelectListTotalCnt(condition)));
		
		return resultMap;
	}

	@Override
	public EventFile findby(Map<String, Object> condition) throws Exception {
		// TODO Auto-generated method stub
		return eventFileDao.select(condition);
	}

	@Override
	public EventFile add(EventFile eventFile) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EventFile modify(EventFile eventFile) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int remove(Map<String, Object> condition) throws Exception {
		// TODO Auto-generated method stub
		return eventFileDao.delete(condition);
	}

}
